
import {createRouter,createWebHashHistory} from 'vue-router'
import queryFrom from '../components/queryFrom.vue'
import queryTo from '../components/queryTo.vue'
import pathFrom from '../components/pathFrom.vue'
import pathTo from '../components/pathTo.vue'

let router = createRouter({
    history: createWebHashHistory(),
    routes:[
        {
            path:"/",
            redirect:"/query/from"
        } ,
        {
            path: "/query/from",
            component: queryFrom
        },
        {
            path:"/query/to",
            component: queryTo
        },
        /**
         * 路径传递参数: 
         *   springmvc  路径就是动态的   /{key}/{key}  -> /1/1/
         * 路由参数:
         *    /path/to/{id}/{name}
         */
        {
            path:"/path/from",
            component: pathFrom
        },
        // /path/to/:id/:name   
        {
            path:"/path/to/:id/:name",
            name: "pathTo",
            component: pathTo
        }
    ]
});


export default router;